<?php

/**
 * MVM_MALL 网上商店系统 订单查询
 * ============================================================================
 * 版权所有 (C) 2007-2010 www.mvmmall.com，并保留所有权利。
 * 网站地址: http://www.mvmmall.com
 * ----------------------------------------------------------------------------
 * 这是一个免费开源的软件；这意味着您可以在不用于商业目的的前提下对程序代码
 * 进行修改、使用和再发布。
 * ============================================================================
 * $Author:  www.mvmmall.com  $
 * $Date: 2008-05-12 $
 * $Id: order.php  www.mvmmall.com$
 * ---------------------------------------------
*/

require_once 'include/common.inc.php';
if ($action=='list') {
	/**如果已经登陆，转到会员中心，我的定单**/
	$m_check_id && move_page('member.php?action=order');
	$navigation  = make_navigation($lang['order_scarch'],GetBaseUrl('order','list'));
	require_once MVMMALL_ROOT.'header.php';
	require_once template('order');
	footer();
}elseif ($action=='query' ){
    require_once MVMMALL_ROOT.'./include/json.class.php';
    $json = new Services_JSON;
    $search_sql = false;
    $order_num  = dhtmlchars($order_num);
    $order_info = $db->get_one("SELECT * FROM `{$tablepre}order_info` WHERE ordersn = '$order_num'");
    if ($order_info == false) {
        echo $json->encode(array('err'=>$lang['db_avess']));
        exit;
    }else {
        $order_info == false &&  $json->encode(array('err'=>$lang['db_avess']));
        $order_info['sendtime']      = $order_info['sendtime'] ? date($mm_date_format,$order_info['sendtime']):'';
        $order_info['delivery_code'] = $order_info['delivery_code'] ? $order_info['delivery_code'] : '';
        $order_info['status']        = $m_order_array[$order_info['status']];
        echo $json->encode($order_info);
    }
}
else {
	show_msg('pass_worng');
}

